Prepare

Completed

You're building a declarative agent for Microsoft 365 Copilot that answers a user's questions using your data. Here, we discuss the project business logic and target behavior. We also cover the accounts and software you need.

Project specification

You have an OpenAPI specification for your API.

The API specification:

  • Only contains the relevant operations
  • Includes relevant descriptions to explain the purpose of each operation, parameter, and property

The declarative agent:

  • Is available within Microsoft 365 Copilot
  • Provides examples of how users can ask it questions
  • Answers a user's questions using the information from the referenced API
  • Displays the data from the API using an Adaptive Card
  • Displays relevant information in citations
  • Politely refuses to answer questions not related to its function
  • Admits when it doesn't have relevant information to answer a user's question

Setup

To complete this challenge, you need a Microsoft 365 tenant with Microsoft 365 Copilot, Visual Studio Code, and the Teams Toolkit extension.

Get a Microsoft 365 tenant with Microsoft 365 Copilot

To complete this exercise, you need a Microsoft 365 tenant with Microsoft 365 Copilot.

Northwind Traders API

Here we provide a sample API for you to use in the challenge. The Northwind Traders API is a sample OData service that provides access to data about products, customers, and orders. You can use this API to test your declarative agent.

The following HTTP request shows how to call the Northwind Traders API to get a list of customers in JSON format:

GET https://services.odata.org/northwind/northwind.svc/Customers
accept: application/json

Tip

Use Dev Proxy to easily generate an OpenAPI spec for your API

Install Visual Studio Code

You build the agent using Visual Studio Code. Visual Studio Code is an IDE that provides you with tooling to build agents for Microsoft 365 Copilot. To install Visual Studio Code for your operating system, visit https://code.visualstudio.com/.

Install Teams Toolkit extension for Visual Studio Code

Teams Toolkit is a Visual Studio Code extension that helps developers build agents for Microsoft 365 Copilot. It provides you with the project boilerplate and tasks to automate building and deploying agents. To install the Teams Toolkit extension for Visual Studio Code visit https://marketplace.visualstudio.com/items?itemName=TeamsDevApp.ms-teams-vscode-extension.